{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 ;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\lang1033\f0\fs20 ; <<< Use Configuration Wizard in Context Menu >>>\par
;******************************************************************************\par
;\par
; Startup.s - Startup code for use with Keil's uVision.\par
;\par
; Copyright (c) 2007 Luminary Micro, Inc.  All rights reserved.\par
; \par
; Software License Agreement\par
; \par
; Luminary Micro, Inc. (LMI) is supplying this software for use solely and\par
; exclusively on LMI's microcontroller products.\par
; \par
; The software is owned by LMI and/or its suppliers, and is protected under\par
; applicable copyright laws.  All rights are reserved.  Any use in violation\par
; of the foregoing restrictions may subject the user to criminal sanctions\par
; under applicable laws, as well as to civil liability for the breach of the\par
; terms and conditions of this license.\par
; \par
; THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED\par
; OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF\par
; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.\par
; LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR\par
; CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.\par
; \par
; This is part of revision 1716 of the Stellaris Peripheral Driver Library.\par
;\par
;******************************************************************************\par
\par
;******************************************************************************\par
;\par
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>\par
;\par
;******************************************************************************\par
Stack   EQU     0x00000100\par
\par
;******************************************************************************\par
;\par
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>\par
;\par
;******************************************************************************\par
Heap    EQU     0x00000000\par
\par
;******************************************************************************\par
;\par
; Allocate space for the stack.\par
;\par
;******************************************************************************\par
        AREA    STACK, NOINIT, READWRITE, ALIGN=3\par
StackMem\par
        SPACE   Stack\par
__initial_sp\par
\par
;******************************************************************************\par
;\par
; Allocate space for the heap.\par
;\par
;******************************************************************************\par
        AREA    HEAP, NOINIT, READWRITE, ALIGN=3\par
__heap_base\par
HeapMem\par
        SPACE   Heap\par
__heap_limit\par
\par
;******************************************************************************\par
;\par
; Indicate that the code in this file preserves 8-byte alignment of the stack.\par
;\par
;******************************************************************************\par
        PRESERVE8\par
\par
;******************************************************************************\par
;\par
; Place code into the reset code section.\par
;\par
;******************************************************************************\par
        AREA    RESET, CODE, READONLY\par
        THUMB\par
\par
\par
\tab\tab EXTERN ADCIntHandler \par
\par
;******************************************************************************\par
;\par
; The vector table.\par
;\par
;******************************************************************************\par
        EXPORT  __Vectors\par
__Vectors\par
        DCD     StackMem + Stack            ; Top of Stack\par
        DCD     Reset_Handler               ; Reset Handler\par
        DCD     NmiSR                       ; NMI Handler\par
        DCD     FaultISR                    ; Hard Fault Handler\par
        DCD     IntDefaultHandler           ; MPU Fault Handler\par
        DCD     IntDefaultHandler           ; Bus Fault Handler\par
        DCD     IntDefaultHandler           ; Usage Fault Handler\par
        DCD     0                           ; Reserved\par
        DCD     0                           ; Reserved\par
        DCD     0                           ; Reserved\par
        DCD     0                           ; Reserved\par
        DCD     IntDefaultHandler           ; SVCall Handler\par
        DCD     IntDefaultHandler           ; Debug Monitor Handler\par
        DCD     0                           ; Reserved\par
        DCD     IntDefaultHandler           ; PendSV Handler\par
        DCD     IntDefaultHandler           ; SysTick Handler\par
        DCD     IntDefaultHandler           ; GPIO Port A\par
        DCD     IntDefaultHandler           ; GPIO Port B\par
        DCD     IntDefaultHandler           ; GPIO Port C\par
        DCD     IntDefaultHandler           ; GPIO Port D\par
        DCD     IntDefaultHandler           ; GPIO Port E\par
        DCD     IntDefaultHandler           ; UART0\par
        DCD     IntDefaultHandler           ; UART1\par
        DCD     IntDefaultHandler           ; SSI\par
        DCD     IntDefaultHandler           ; I2C\par
        DCD     IntDefaultHandler           ; PWM Fault\par
        DCD     IntDefaultHandler           ; PWM Generator 0\par
        DCD     IntDefaultHandler           ; PWM Generator 1\par
        DCD     IntDefaultHandler           ; PWM Generator 2\par
        DCD     IntDefaultHandler           ; Quadrature Encoder\par
        DCD     ADCIntHandler               ; ADC Sequence 0\par
        DCD     IntDefaultHandler           ; ADC Sequence 1\par
        DCD     IntDefaultHandler           ; ADC Sequence 2\par
        DCD     IntDefaultHandler           ; ADC Sequence 3\par
        DCD     IntDefaultHandler           ; Watchdog\par
        DCD     IntDefaultHandler           ; Timer 0A\par
        DCD     IntDefaultHandler           ; Timer 0B\par
        DCD     IntDefaultHandler           ; Timer 1A\par
        DCD     IntDefaultHandler           ; Timer 1B\par
        DCD     IntDefaultHandler           ; Timer 2A\par
        DCD     IntDefaultHandler           ; Timer 2B\par
        DCD     IntDefaultHandler           ; Comp 0\par
        DCD     IntDefaultHandler           ; Comp 1\par
        DCD     IntDefaultHandler           ; Comp 2\par
        DCD     IntDefaultHandler           ; System Control\par
        DCD     IntDefaultHandler           ; Flash Control\par
\par
;******************************************************************************\par
;\par
; This is the code that gets called when the processor first starts execution\par
; following a reset event.\par
;\par
;******************************************************************************\par
        EXPORT  Reset_Handler\par
Reset_Handler\par
        ;\par
        ; Call the C library enty point that handles startup.  This will copy\par
        ; the .data section initializers from flash to SRAM and zero fill the\par
        ; .bss section.\par
        ;\par
        IMPORT  __main\par
        B       __main\par
\par
;******************************************************************************\par
;\par
; This is the code that gets called when the processor receives a NMI.  This\par
; simply enters an infinite loop, preserving the system state for examination\par
; by a debugger.\par
;\par
;******************************************************************************\par
NmiSR\par
        B       NmiSR\par
\par
;******************************************************************************\par
;\par
; This is the code that gets called when the processor receives a fault\par
; interrupt.  This simply enters an infinite loop, preserving the system state\par
; for examination by a debugger.\par
;\par
;******************************************************************************\par
FaultISR\par
        B       FaultISR\par
\par
;******************************************************************************\par
;\par
; This is the code that gets called when the processor receives an unexpected\par
; interrupt.  This simply enters an infinite loop, preserving the system state\par
; for examination by a debugger.\par
;\par
;******************************************************************************\par
IntDefaultHandler\par
        B       IntDefaultHandler\par
\par
;******************************************************************************\par
;\par
; Make sure the end of this section is aligned.\par
;\par
;******************************************************************************\par
        ALIGN\par
\par
;******************************************************************************\par
;\par
; Some code in the normal code section for initializing the heap and stack.\par
;\par
;******************************************************************************\par
        AREA    |.text|, CODE, READONLY\par
\par
;******************************************************************************\par
;\par
; The function expected of the C library startup code for defining the stack\par
; and heap memory locations.  For the C library version of the startup code,\par
; provide this function so that the C library initialization code can find out\par
; the location of the stack and heap.\par
;\par
;******************************************************************************\par
    IF :DEF: __MICROLIB\par
        EXPORT  __initial_sp\par
        EXPORT  __heap_base\par
        EXPORT  __heap_limit\par
    ELSE\par
        IMPORT  __use_two_region_memory\par
        EXPORT  __user_initial_stackheap\par
__user_initial_stackheap\par
        LDR     R0, =HeapMem\par
        LDR     R1, =(StackMem + Stack)\par
        LDR     R2, =(HeapMem + Heap)\par
        LDR     R3, =StackMem\par
        BX      LR\par
    ENDIF\par
\par
;******************************************************************************\par
;\par
; Make sure the end of this section is aligned.\par
;\par
;******************************************************************************\par
        ALIGN\par
\par
;******************************************************************************\par
;\par
; Tell the assembler that we're done.\par
;\par
;******************************************************************************\par
        END\par
}
 